import service from "./http";

interface resType {
    code: number;
    data?: any;
    msg: string;
    rows?: any[];
    total?: number;
}

const API = {

    // login
    loginAPI: (params: any) => service.post<resType>('/user/login', params),

    // register
    registerAPI: (params: any) => service.post<resType>('/user/register', params),

    // changepassWord
    changePasswordAPI: (params: any) => service.post('/user/changePassword', params),
    // investList
    investListAPI: (params: any) => service.post('/investDraw/investList', params),
    // upload
    uploadAPI: (params: any) => service.upload('/file/upload', params),
    // investDraw
    investDrawAPI: (params: any) => service.post('/investDraw/invest', params),
    // drawList
    drawListAPI: (params: any) => service.post('/investDraw/drawList', params),
    // withDraw
    withDrawAPI: (params: any) => service.post('/investDraw/draw', params),
    // userInvestDrawList
    userInvestDrawListAPI: (params: any) => service.post('/investDraw/userInvestDrawList', params),

    // getMoney获取余额
    getMoneyAPI: (params: any) => service.post<resType>('/user/getMoney', params),

    // 我的彩票列表
    getMyOrderList: (params: any) => service.post<resType>('/userOrder/list', params),

    // 首页list
    getlotteryList: (params: any) => service.post<resType>('/lottery/lotteryList', params),

    // 下注规则
    getlotteryClass: (params: any) => service.post<resType>('/lottery/lotteryClass', params),

    // 下注
    orderlotteryBet: (params: any) => service.post<resType>('/userOrder/bet', params),

    // goldRecordList
    goldRecordListAPI: (params: any) => service.post<resType>('/userGold/goldRecordList', params),

    // planList
    planListAPI: (params: any) => service.post<resType>('/userOrder/planList', params),

    // 我的彩票-抽奖
    receiveAPI: (params: any) => service.post<resType>('/userOrder/receive', params),

    //结果
    lotteryPeriodListAPI: (params: any) => service.post<resType>('/lottery/lotteryPeriodList', params),

    // 网站配置
    webConfigAPI: (params: any) => service.post<resType>('/lottery/lotteryWebConfig', params),

    // 时彩列表
    lotteryPrivateAPI: (params: any) => service.post<resType>('/lotteryPrivate/lotteryList', params),
     // 提交时彩
    privateOrderBetApi: (params: any) => service.post<resType>('/userPrivateOrder/bet', params),

    // 赛马历史
    privateSmOrderListApi: (params: any) => service.post<resType>('/userPrivateOrder/smOrderList', params),

    // 首页banner和彩票图片
    lotteryType: (params: any) => service.post<resType>('/lotteryType/list', params),

    // 多语言配置
    langList: (params: any) => service.post<resType>('/lotteryLan/lanList', params),

    // 广告列表
    getAdvertiseList: (params: any) => service.post<resType>('/advertise/webList', params),

    // 跑马灯
    getMarqueeList: (params: any) => service.post<resType>('/marquee/webList', params),
    
    // 充值
    goPayRecharge: (params: any) => service.post<resType>('/inPay/pay', params),
    
    goUserBank: (params: any) => service.post<resType>('/inPay/userBank', params),

    // 提现
    goPayDraw: (params: any) => service.post<resType>('/inPay/draw', params),

    // 推荐好友配置
    getConfig: (params: any) => service.post<resType>('/user/getConfig', params),

    // 获取手机验证码
    getPhoneCode: (params: any) => service.post<resType>('/sms/send', params),
    
    // 获取邮箱验证码
    getMailCode: (params: any) => service.post<resType>('/sample/send', params),

};

export default API;
